package com.bw.doctor.controller;
/**
 * @Author：尚志豪
 * @Package：com.bw.system.controller
 * @Project：doudi-group2-shixun-02
 * @name：PrivateDoctorController
 * @Date：2025/2/24 20:52
 */

import com.bw.common.core.domain.Result;
import com.bw.common.core.web.controller.BaseController;
import com.bw.doctor.domain.ConsultationRecord;
import com.bw.doctor.domain.Patient;
import com.bw.doctor.service.PrivateDoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: doudi-group2-shixun-02
 * @description: 私人医生管理
 * @author: CuiFu Bo
 * @create: 2025-02-24 20:52
 **/
@RestController
@RequestMapping("/privateDoctor")
public class PrivateDoctorController extends BaseController
{
    @Autowired
    private PrivateDoctorService privateDoctorService;
    /**
     * 查询问诊服务
     */
    @PostMapping("/checkByLoginDoctorId")
    public Result checkByLoginDoctorId(Long doctorId, Long state)
    {
        startPage();
        List<Patient> list = privateDoctorService.checkByLoginDoctorId(doctorId, state);
        return getDataTable(list);
    }

    /**
     * 通过患者问诊id查询详情
     */
    @PostMapping("/queryPatientInformationByPatientId")
    public Result<Patient> queryPatientInformationByPatientId(Long patientId)
    {
        Patient patient = privateDoctorService.queryPatientInformationByPatientId(patientId);
        return Result.success(patient);
    }

    /**
     * 通过患者问诊id查询问诊记录
     */
    @PostMapping("/queryTheConsultationRecordByThePatientsConsultationId")
    public Result<List<ConsultationRecord>> queryTheConsultationRecordByThePatientsConsultationId(Long patientId)
    {
        List<ConsultationRecord> consultationRecordList = privateDoctorService.queryTheConsultationRecordByThePatientsConsultationId(patientId);
        return Result.success(consultationRecordList);
    }

}
